home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6239 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: opera.iinet.net.au!news
  2. From: random@opera.iinet.net.au (Billy Shields)
  3. Newsgroups: comp.lang.c,iinet.general,comp.os.msdos.programmer,comp.os.msdos.misc,alt.msdos.programmer
  4. Subject: Re: Checking for floppy disk??
  5. Followup-To: comp.lang.c,iinet.general,comp.os.msdos.programmer,comp.os.msdos.misc,alt.msdos.programmer
  6. Date: 22 Feb 1996 17:21:57 +0800
  7. Organization: iiNet Technologies
  8. Message-ID: <4ghcjl$eed@opera.iinet.net.au>
  9. References: <4f9rdq$rnk@opera.iinet.net.au>
  10. NNTP-Posting-Host: localhost
  11. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  12.  
  13. I believe you have to disable the DOS Critical Error Handler
  14. (if I remember correctly).  I think Turbo Debugger ignores the
  15. Critical Error Handler but running normally its quite active.
  16. Disabling it usually involves setting a new Interrupt Service
  17. Routine for it (I think its int 24h but double check that).
  18.  
  19. Billy
  20.  
  21. Marcus Schnell (marcus@opera.iinet.net.au) wrote:
  22. : This piece of code is supposed to check if a floppy disk in
  23. : in drive A:
  24. : void c_CheckPCMCIADevice(void) {
  25. :    struct diskfree_t drive;
  26. :    while (_dos_getdiskfree(1, &drive)) {
  27. :       printf("Try again...\n");
  28. :       getc();
  29. :      };
  30. :    printf("OK, disk inserted.\n");
  31. : };
  32. : If I run this program in the debugger (Turbo Debugger) it works fine,
  33. : ie. it goes into the loop and prompts me until I have inserted a
  34. : disk. If I run the program without the debugger, I get the DOS error
  35. : message:
  36. : Not ready reading drive A:
  37. : Abort, Retry, Fail?
  38. : Why does it behave differently in the debugger and how can I 
  39. : disable the ugly DOS error message outside the debugger???
  40. : I am using Borland C++ 4.5, but my application is straight DOS
  41. : and only C, no C++.
  42. : Thanks,
  43. : Marcus
  44. : marcus@iinet.com.au
  45.